package team.se.tms.exception;

import lombok.Getter;

/**
 * 自定义异常
 *
 * @author winkyle
 * @date 2018/11/15
 */
@Getter
public class CustomException extends RuntimeException{

    private Integer code;
    private Object data;

    /**
     * 带数据的自定义异常构造器
     *
     * @param code 信息码
     * @param msg 信息
     * @param data 数据
     * @create on 2018/11/15 by winkyle
     */
    public CustomException(int code, String msg,Object data) {
        super(msg);
        this.code = code;
        this.data = data;
    }

    /**
     * 不带数据的自定义异常构造器
     *
     * @param code 信息码
     * @param msg 信息
     * @create on 2018/11/15 by winkyle
     */
    public CustomException(int code, String msg) {
       this(code,msg,null);
    }
}
